const http = uni.$u.http

// 根据key获取业务参数配置详细信息
export const getByKeyApi = (configKey) => http.get('/business/business/getByKey', { params: { configKey } })
export const getDictTypeApi = (dictType) => http.get('/system/dict/data/type/' + dictType)
//绑定手机号
export const bindPhoneApi = (form) => http.post('/auth/bindPhone', {}, { params: form })

//查询景点列表
export const getGoodsListApi = (query) => http.get('/business/goods/list', { params: query })

export const getGoodsApi = (goodsId) => http.get('/business/goods/' + goodsId)

export const addOrderApi = (query) => http.post('/business/order/createOrder', {}, { params: query })
//余额支付
export const createOrderByAmountApi = (query) => http.post('/business/order/createOrderByAmount', {}, { params: query })

// 绑定邀请人
export const bindSuperiorApi = (userId) => http.get('/business/vip/bindSuperior', { params: { userId }, custom: { showSuccess: false, showError: false } });
export const bindSuperiorHandApi = (userId) => http.get('/business/vip/bindSuperiorHand', { params: { userId } });
//团队列表
export const getMyTeamApi = (query) => http.get('/business/vip/getMyTeam', { params: query })
export const topUpApi = (data) => http.post('/pay/topUp', data)

// 获取我的详细信息(商户)
export const getMyInfoApi = () => http.get('/business/vip/getMyInfo')
export const getUserInfoApi = (query) => http.get('/business/vip/getUserInfo', { params: query })

export const oderListApi = (query) => http.get('/business/order/list', { params: query })
export const getOrderApi = (orderId) => http.get('/business/order/' + orderId)

export const removeOderApi = (goodsGoodsIds) => http.delete('/business/order/' + goodsGoodsIds)
export const confirmOrderApi = (orderId) => http.post('/business/order/confirmOrder', {}, { params: { orderId } })
export const resubmitOrderApi = (orderId) => http.post('/business/order/resubmitOrder', {}, { params: { orderId } })

// 修改微信昵称图像
export const updateWxInfo = (nickName, avatar) => http.post('/business/vip/updateWxInfo', {}, { params: { nickName, avatar }, custom: { successMsg: "修改成功" } });
export const updateAddressApi = (params) => http.post('/business/vip/updateAddress', {}, { params: params });
export const updateOrderAddressApi = (params) => http.post('/business/vip/updateOrderAddress', {}, { params: params });

// 购物车
export const addCartApi = (data) => http.post('/business/cart/add', {}, { params: data })
export const addCartByCartApi = (data) => http.post('/business/order/createOrderByShoppingCartId', {}, { params: data })
//微信支付
export const addCartByPayCartApi = (data) => http.post('/business/order/createPayOrderByShoppingCartId', {}, { params: data })
export const getCartApi = (query) => http.get('/business/cart/list', { params: query })

// 提现
export const auditApi = (data) => http.post('/business/audit', data, { custom: { showSuccess: true, successMsg: "操作成功" } })
//流水
export const getFlowingApi = (query) => http.get('/business/flowing/list', { params: query })
export const getAuditListApi = (query) => http.get('/business/audit/list', { params: query })
//商品
export const addGoodsApi = (data) => http.post('/business/goods/add', data, { custom: { showSuccess: true, successMsg: "操作成功" } })
export const updateGoodsStatusApi = (query) => http.put('/business/goods/updateGoodsStatus', {}, { params: query }, { custom: { showSuccess: true, successMsg: "操作成功" } })
export const removeGoodsApi = (goodsIds) => http.delete('/business/goods/' + goodsIds)
export const removeCartApi = (goodsIds) => http.delete('/business/cart/remove/' + goodsIds)
export const getUnReadApi = (query) => http.get('/business/message/getUnRead', { params: query })
export const getRoomListApi = (query) => http.get('/business/message/getRoomList', { params: query })
export const removeRoomApi = (query) => http.delete('/business/message/removeRoom', {}, { params: query })
export const getMsgListApi = (query) => http.get('/business/message/getMsgList', { params: query })
export const messageSendApi = (query) => http.post('/business/message/sendByRoomId', {}, { params: query })
export const getRoomIdApi = (query) => http.get('/business/message/getRoomId', { params: query })

export const goodsLikeApi = (query) => http.post('/business/goods/like', {}, { params: query })
export const goodsMyLikeApi = (query) => http.get('/business/goods/myLike', { params: query })

export const userLikeApi = (query) => http.post('/business/vip/like', {}, { params: query })
export const userMyLikeApi = (query) => http.get('/business/vip/myLike', { params: query })

//入驻
export const addJoinApi = (data) => http.post('/business/joinAudit', data)
//待核查列表
export const unCheckListApi = (query) => http.get('/business/order/unCheckList', { params: query })
export const myCheckListApi = (query) => http.get('/business/order/myCheckList', { params: query })
export const checkApi = (orderId) => http.put('/business/order/check', {}, { params: { orderId } })
export const submitResultApi = (data) => http.put('/business/order/submitResult', data)
//发货
export const deliveryApi = (params) => http.put('/business/order/delivery', {}, { params: params })
export const confirmedApi = (orderId) => http.put('/business/order/confirmed', {}, { params: { orderId } })
//查询订单号
export const getTopUpApi = (orderId) => http.get('/topUp/getByOrderId', { params: { orderId } })

// 查询地区列表
export const getAreaListApi = () => http.get('/system/area/list')
//获取地址
export const getAddressApi = (query) => http.get('/business/vip/getAddress', { params: query })
export const getCityApi = (query) => http.get('/business/vip/getCity', { params: query })
//发起退款
export const refundApi = (orderId) => http.post('/business/refund', {}, { params: { orderId } })

export const getOrderByGoodsIdApi = (goodsId) => http.get('/business/order/getOrderByGoodsId', { params: { goodsId } })
//当前订单是否已申请退款
export const getIsRefundApi = (orderId) => http.get('/business/refund/getIsRefund', { params: { orderId } })
//申诉
export const complaintsApi = (query) => http.put('/business/order/complaints', {}, { params: query })
export const agreedComplaintsApi = (orderId) => http.put('/business/order/agreedComplaints', {}, { params: { orderId } })
export const refusedComplaintsApi = (orderId) => http.put('/business/order/refusedComplaints', {}, { params: { orderId } })
//查询拼团列表
export const togetherListApi = (query) => http.get('/business/together/list', { params: query })
//查询拼团列表列表
export const togetherListListApi = (query) => http.get('/business/togetherList/list', { params: query })
//开团
export const togetherStartApi = (togetherId) => http.post('/business/togetherList/start', {}, { params: { togetherId } })
//查询优惠券
export const getCouponApi = () => http.get('/business/business/getCoupon')
export const getGoodsCouponApi = () => http.get('/business/goodsCoupon/getCoupon')
export const getMyCouponApi = (query) => http.get('/business/coupon/list', { params: query })
export const receiveCouponApi = (configId) => http.post('/business/coupon/receive', {}, { params: { configId } })



export const getRankingsApi = (query) => http.get('/business/vip/getRankings', { params: query })
export const getHistorySignApi = () => http.get('/business/vip/getHistorySign')
export const getTodayAmountApi = () => http.get('/business/vip/getTodayAmount')
export const signApi = (goodsOrderId) => http.get('/business/vip/sign', { params: { goodsOrderId } })
export const postAddOrderApi = (data) => http.post('/business/order/addOrder', data)
export const postAddOrderTopUpApi = (data) => http.post('/business/order/addOrderTopUp', data)
export const putAddMemberApi = (data) => http.put('/business/order/addMember', {},{ params: data })
//抽奖
export const cjApi = (data) => http.put('/business/vip/cj', {}, { params: data })
export const putOrderRemoveApi = (query) => http.put('/business/order/remove', {}, { params: query })
export const putOrderEndApi = (query) => http.put('/business/order/end', {}, { params: query })
export const putOrderWaiterEndApi = (query) => http.put('/business/order/waiterEnd', {}, { params: query })
export const putOrderCheckApi = (query) => http.put('/business/order/check', {}, { params: query })
export const addPostApi = (data) => http.post('/business/post', data)
export const getPostListApi = (query) => http.get('/business/post/list', { params: query })
export const vipJoinApi = (query) => http.post('/business/vip/join', {}, { params: query })

export const getUserListApi = (query) => http.get('/business/businessUser/list', { params: query })
export const vipGiveApi = (query) => http.post('/business/vip/give', {},{ params: query })
//积分商城
export const getGoodsMallListApi = (query) => http.get('/business/mall/list', { params: query })
export const getOrderNoticeApi = (query) => http.get('/business/order/getOrderNotice', { params: query })
